package cn.wyf.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

import cn.wyf.demo.model.Role;
import cn.wyf.demo.service.RoleService;

@Controller
@RequestMapping("/role")
public class RoleController {

    public RoleService roleService;

    @Autowired
    public void setRoleService(RoleService roleService) {
        this.roleService = roleService;
    }

    @RequestMapping(value = "/querys",method = RequestMethod.GET)
    @ResponseBody
    public List<Role> querys(){
        System.out.println("=============");
        return roleService.querys();
    }
}